<template>
  <div>
    <ul>
       <li v-for="(val,index) in arr">
         <span>{{val}}</span>
         <button @click="del">删除</button>
       </li>
    </ul>
    <button @click="generate">生成</button>
  </div>
</template>

<script>
export default {
   data () {
     return {
      arr:[1,3,5,6]
     }
   }, 
   methods: {
     del(index){
       this.arr.splice(index,1)
     },
     generate(){
       this.arr.push(Math.floor(Math.random()*20))
     }
   }
}
</script>

<style>

</style>